package com.eugenezadyra.rsstotwitter.model;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * @author eugene zadyra
 */
@Entity(name = "feed")
public class Feed extends AbstractEntity{
	private String name;
	@Column(unique = true)
	private String url;
	@OneToMany(mappedBy = "feed")
	private List<FeedMessage> feedMessages;
	@OneToMany(mappedBy = "feed")
	private List<TwitterFeedSubscription> twitterFeedSubscriptions;
	@Column(name = "fetched_date")
	private Date fetchedDate;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<FeedMessage> getFeedMessages() {
		return feedMessages;
	}

	public void setFeedMessages(List<FeedMessage> feedMessages) {
		this.feedMessages = feedMessages;
	}

	public List<TwitterFeedSubscription> getTwitterFeedSubscriptions() {
		return twitterFeedSubscriptions;
	}

	public void setTwitterFeedSubscriptions(List<TwitterFeedSubscription> twitterFeedSubscriptions) {
		this.twitterFeedSubscriptions = twitterFeedSubscriptions;
	}

	public Date getFetchedDate() {
		return fetchedDate;
	}

	public void setFetchedDate(Date fetchedDate) {
		this.fetchedDate = fetchedDate;
	}
}
